import instance from '../../utils/request'
export default {
  namespaced: true,
  state: {
    AuditList: [],
    total: 0
  },
  mutations: {
    setAuditList (state, payload) {
      state.AuditList = payload.AuditList
    },
    setTotal (state, payload) {
      state.total = payload.total
    }
  },
  actions: {
    async getAuditList ({
      commit
    }, payload) {
      const res = await instance.get('/audit', {
        params: {
          ...payload,
          pid: 0
        }
      })
      if (res.data.code === 1) {
        commit('setAuditList', {
          AuditList: res.data.data.data
        })
        commit('setTotal', {
          total: res.data.data.total
        })
      }
    }
  },
  modules: {}
}
